<template>
	<el-table :data="props.tableData" class="zs-tabel-page-main-no-footer" :stripe="true">
		<el-table-column type="index" label="序号" width="60" align="center" />
		<el-table-column prop="projectName" label="项目" align="left" />
		<el-table-column prop="bizType" label="业态" align="center">
			<template #default="scope">
				{{ getDictLabel(dictObj['PROJECT_COMMERCIAL_ACTIVITIES'], scope.row.bizType) }}
			</template>
		</el-table-column>
		<el-table-column prop="phase" label="阶段" align="center">
			<template #default="scope">
				{{ getDictLabel(dictObj['PROJECT_STAGE'], scope.row.phase) }}
			</template>
		</el-table-column>
		<el-table-column label="集团" align="center">
			<template #default="scope">
				{{ getDictLabel(dictObj['INVESTOR'], scope.row.investor) }}
			</template>
		</el-table-column>
		<el-table-column prop="city" label="城市" align="center">
			<template #default="scope">
				{{ getCityLabel(scope.row.city) }}
			</template>
		</el-table-column>
		<el-table-column prop="yesterdayCommonDosage" :label="tag + '公区用电量'" align="right" />
		<el-table-column prop="yesterdayCommerceDosage" :label="tag + '商户用电量'" align="right" />
		<el-table-column label="操作" width="80" align="right">
			<template #default="scope">
				<el-button class="zs-link" link size="small" @click="goPage(scope.row)">查看</el-button>
			</template>
		</el-table-column>
	</el-table>
</template>

<script setup>
	import { getDictLabel, getCityLabel } from '@/utils/dbUtil';
	import { useStore } from 'vuex';
	import { useRouter } from 'vue-router';
	const router = useRouter();
	let store = useStore();
	const dictObj = store.getters.getDictObj(['INVESTOR', 'PROJECT_STAGE', 'PROJECT_COMMERCIAL_ACTIVITIES']);

	const props = defineProps({
		updateDate: {
			type: String,
			required: false,
		},
		tag: {
			type: String,
			required: false,
		},
		tabPermi: {
			type: String,
			required: false,
		},
		tableData: {
			type: Array,
			required: false,
		},
		pageSize: {
			type: Number,
			required: false,
		},
		pageNumber: {
			type: Number,
			required: false,
		},
	});

	const goPage = row => {
		router.push({
			path: '/page/routeController/index',
			query: {
				rid: 'EnergyElectricity',
				rTitle: '能源明细表',
				projectCode: row.projectCode,
				projectName: row.projectName,
				showTimeStamp: new Date(props.updateDate).getTime(),
				source: 'dashboard'
			},
		});
	};
</script>

<style scoped lang="scss"></style>
